package com.jiazhong.aop.calculator;

/**
 * @Auther:shuXin
 * 静态代理的模式
 */
public class CalculatorStaticProxy implements Calculator {
    //传递接口的对象
    private Calculator calculator;

    public CalculatorStaticProxy(Calculator calculator) {
        this.calculator = calculator;
    }


    @Override
    public int add(int i, int j) {
        System.out.println("[日志] add 方法开始了，参数是：" + i + "," + j);
        int result = calculator.add(i, j);
        System.out.println("方法内部 result = " + result);
        System.out.println("[日志] add 方法结束了，结果是：" + result);
        return 0;
    }

    @Override
    public int aub(int i, int j) {
        return 0;
    }

    @Override
    public int mul(int i, int j) {
        return 0;
    }

    @Override
    public int dev(int i, int j) {
        return 0;
    }
}
